home *** CD-ROM | disk | FTP | other *** search
/ GQ - Louise, World Cup, …remy Clarkson, Armageddon / GQCD.iso / files / premier / media / net.dxr / 00002_Move Left Horizontal.ls < prev    next >
Encoding:
Text File  |  1998-05-13  |  942 b   |  22 lines

  1. property myWidth, myOffset, mySpriteWidth
  2.  
  3. on exitFrame me
  4.   if the locH of sprite the currentSpriteNum > (mySpriteWidth * -1) then
  5.     set the locH of sprite the currentSpriteNum to the locH of sprite the currentSpriteNum - myOffset
  6.   else
  7.     set the locH of sprite the currentSpriteNum to myWidth + mySpriteWidth
  8.   end if
  9. end
  10.  
  11. on getBehaviorDescription
  12.   return "This moves a sprite from left to right by a value (myOffset) across a stage which is (myWidth) wide. If it goes beyond the stage boundary it restarts at the other side."
  13. end
  14.  
  15. on getPropertyDescriptionList
  16.   set description to [:]
  17.   addProp(description, #mySpriteWidth, [#default: 25, #format: #integer, #comment: "Width of sprite:"])
  18.   addProp(description, #myOffset, [#comment: "Distance of pixels to move per frame:", #format: #integer, #default: 1])
  19.   addProp(description, #myWidth, [#comment: "Width of stage:", #format: #integer, #default: 640])
  20.   return description
  21. end
  22.